package org.sixtythousand.joker.servlet;

import org.sixtythousand.joker.servlet.servlet.ServletWrapper;

import javax.servlet.Servlet;
import javax.servlet.http.HttpServletRequest;

/**
 * @author zhoulk
 * @date 2023/10/13 16:05
 * @desc
 */
public class ServletMapping {
    private ServletWrapper servlet;
    private String path;


    public ServletMapping(String path, ServletWrapper servlet) {
        this.path = path;
        this.servlet = servlet;
    }

    public boolean isMatch(HttpServletRequest request) {
        request.getRequestURI();
        return request.getServletPath().startsWith(path);
    }

    public ServletWrapper getServlet() {
        return servlet;
    }
}
